<!DOCTYPE HTML>
<html style="background: #f3f3f3;">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>法援宝</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/lawyer.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
</head>
<body>
<div id="secHeader">
  <header class="header">
      <a href="javascript:void(0);" onclick="api.closeWin()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
      <h2>意见反馈</h2>
      <a href="tel:1234564801" class="tel_btn"><img src="../image/tel.png" alt=""></a>
  </header>
</div>
<section class="advice_section">
    <div class="advice">
        <ul>
            <li>
                <div class="item">
                    <span>电话：</span>
                    <input type="text" placeholder="请填写联系电话" name='phone'>
                </div>
            </li>
            <li>
                <div class="item">
                    <span>意见反馈：</span>
                </div>
                <textarea name="" id="content" cols="30" rows="10" placeholder="感谢您使用我们的产品，如果在使用中遇到问题，或者有想对我们提出来的意见和建议，欢迎您在这里告诉我们，我们会努力改进我们的产品。"></textarea>
            </li>
        </ul>
    </div>
</section>

<section class="calc_btn">
    <a href="javascript:void (0);" onclick="tijiao()">提交信息</a>
</section>

</body>

<script>
     apiready = function () {
        $api.fixStatusBar( $api.dom('#secHeader') );
      api.setStatusBarStyle({
          style: 'light'
      });
        
    }
    function tijiao(){
        var content=$('#content').val();

        var phone=$("input[name=phone]").val();

        if(content==''){
            api.alert({msg:"请输入意见内容！"});return;
        }
        if(phone==''){
            api.alert({msg:"请输入手机号！"});return;
        }else if( !/^1[34578]\d{9}$/.test(phone)){
            api.alert({msg:"手机号格式错误！"});return;
        }
//alert(icon);

        var  p={token:token,phone:phone,content:content};

        api.ajax({
            url: webSiteUrl+'/app/user/advice',
            method: 'post',
            data: {
                values:p,
            }
        }, function(ret, err) {
            api.hideProgress();

            if(ret.code==200){

                alert(ret.msg);
                /*api.openWin({
                    name: 'selectaddName',
                    url: './usercenter.html',
                    pageParam: {

                    }
                });*/
            }else{
                alert(ret.msg)
            }

        });
    }

</script>
</html>
